//
//  JumpManager.m
//  TooToo
//
//  Created by liuning on 15/12/25.
//  Copyright © 2015年 MoHao. All rights reserved.
//

#import "JumpManager.h"
#import "VMControllerHelper.h"
#import "LoginHelper.h"
#import "SmsCodeController.h"
#import "MyNickNameController.h"
#import "MyTopicController.h"
#import "WalletController.h"
#import "BeeGroupController.h"
#import "BeegroupMoreController.h"
#import "BeeGroupInviteController.h"
#import "TopicDetailController.h"
#import "TopicWriteController.h"
#import "InviteController.h"
#import "AboatViewController.h"

#import "AddWalletController.h"

@interface JumpManager ()
@end

@implementation JumpManager

+(instancetype)sharedManager
{
    static dispatch_once_t queue;
    static JumpManager * manager = nil;
    
    dispatch_once(&queue, ^{
        manager = [[JumpManager alloc]init];
    });
    
    return manager;
}

-(instancetype)init
{
    if (self = [super init]) {
        
    }
    
    return self;
}


-(void)jumpByPageType:(NSString *)pageType pageKey:(id)pageKey
{
    NSLog(@"通用跳转key:%@  type:%@", pageKey,pageType);
    
    if([pageType isEqualToString:@"-1"])
    {
        return;
    }

}

-(void)jumpToHome
{
    
}

-(void)jumpToLogin
{
    [LoginHelper showLoginBySucceed:^{
        
        
    }];
}

-(void)jumpToAboat
{
    AboatViewController *vc = [[AboatViewController alloc] init];
    [self doPushViewController:vc];
}

-(void)jumpToMyNickName
{
    MyNickNameController *vc = [[MyNickNameController alloc] init];
    [self doPushViewController:vc];
}

-(void)jumpToMyNickNameEx
{
    MyNickNameController *vc = [[MyNickNameController alloc] initWithEx];
    [self doPushViewController:vc];
}

-(void)jumpToMyWallet
{
    WalletController *vc = [[WalletController alloc] init];
    [self doPushViewController:vc];
}

-(void)jumpToMyWalletAdd
{
    AddWalletController *vc = [[AddWalletController alloc] initWithType:MyAddType];
    UINavigationController * qNav = [[UINavigationController alloc]initWithRootViewController:vc];
    qNav.navigationBarHidden = YES;
    [self doPresentViewController:qNav];
}

-(void)jumpToBeeWalletAdd
{
    AddWalletController *vc = [[AddWalletController alloc] initWithType:BeeAddType];
    UINavigationController * qNav = [[UINavigationController alloc]initWithRootViewController:vc];
    qNav.navigationBarHidden = YES;
    [self doPresentViewController:qNav];
}

-(void)jumpToTopicWrite:(NSString *)groupId
{
    TopicWriteController *vc = [[TopicWriteController alloc] initWithGroupId:groupId];
    [[VMControllerHelper currentNavigationController] presentViewController:vc animated:YES completion:^{
        
    }];
}

-(void)jumpToMyTopic
{
    MyTopicController *vc = [[MyTopicController alloc] init];
    [self doPushViewController:vc];
}


-(void)jumpToBeeGroup:(id)obj
{
    BeeGroupController *vc = [[BeeGroupController alloc] initWithObj:obj];
    [self doPushViewController:vc];
}

-(void)jumpToBeeGroupMore:(id)obj
{
    BeegroupMoreController *vc = [[BeegroupMoreController alloc] initWithBeeObj:obj];
    [self doPushViewController:vc];
}

-(void)jumpToBeeInviteCode:(id)obj
{
    BeeGroupInviteController *vc = [[BeeGroupInviteController alloc] initWithBeeObj:obj];
    [self doPushViewController:vc];
}

-(void)jumpToTopicDetail:(id)obj
{
    TopicDetailController *vc = [[TopicDetailController alloc] initWithTopic:obj];
    [self doPushViewController:vc];
}

-(void)jumpToSmsCodeByPhone:(NSString *)phone code:(NSString *)code area:(NSString *)area
{
    SmsCodeController *vc = [[SmsCodeController alloc] initWithPhone:phone picCode:code area:area];
    [self doPushViewController:vc];
}

-(void)jumpToShare:(id)obj
{
    InviteController *vc = [[InviteController alloc] initWithObj:obj];
    [self doPresentViewController:vc];
}

-(void)jumpToSysShareImg:(id)img
{
    UIActivityViewController *vc =
    [[UIActivityViewController alloc] initWithActivityItems:@[img] applicationActivities:nil];
    [self doPresentViewController:vc];
}


-(void)doPushViewController:(UIViewController *)viewController
{
    [[VMControllerHelper currentNavigationController]pushViewController:viewController animated:YES];
}

-(void)doPresentViewController:(UIViewController *)viewController
{
    [[VMControllerHelper currentViewController] presentViewController:viewController animated:YES completion:^{
        
    }];
}



@end
